package com.toby;

import com.toby.config.TransactionConfig;
import com.toby.entity.User;
import com.toby.service.PayService;
import com.toby.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @desc: 事务启动类
 * @author: toby
 * @date: 2019/10/7 17:15
 */
public class TransactionMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TransactionConfig.class);
        /*PayService payService = context.getBean(PayService.class);
        payService.pay("88889999",10,1);*/
        UserService userService = context.getBean(UserService.class);
        User user = new User();
        user.setName("toby");
        user.setSex(1);
        user.setAddress("hangzhou");
        userService.addUser(user);
    }
}
